package cn.eli.vue.service.postAnswer.impl;

import cn.eli.vue.entity.PostAnswer;
import cn.eli.vue.mapper.postAnswer.PostAnswerMapper;
import cn.eli.vue.service.postAnswer.PostAnswerService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("PostAnswerService")
public class PostAnswerServiceImpl implements PostAnswerService {
    @Autowired
    PostAnswerMapper postAnswerMapper;

    /*发布回答*/
    @Override
    public int AnswerPost(int user_id,int postAsk_id,String postAnswer_title,String postAnswer_discribe,String postAnswer_img){
        return postAnswerMapper.AnswerPost(user_id,postAsk_id,postAnswer_title,postAnswer_discribe,postAnswer_img);
    }
    /*收藏回答*/
    @Override
    public int AnswerSubscribeInsert(int user_id, int postAnswer_id) {
        return postAnswerMapper.AnswerSubscribeInsert(user_id,postAnswer_id);
    }
    /*收藏回答*/
    @Override
    public int AnswerSubscribeUpdate(int user_id, int postAnswer_id) {
        return postAnswerMapper.AnswerSubscribeUpdate(user_id,postAnswer_id);
    }
    /*取消点赞回答*/
    @Override
    public int AnswerSubscribeCancelDelete(int user_id,int postAnswer_id){
        return postAnswerMapper.AnswerSubscribeCancelDelete(user_id,postAnswer_id);
    }
    /*取消点赞回答*/
    @Override
    public int AnswerSubscribeCancelUpdate(int user_id,int postAnswer_id){
        return postAnswerMapper.AnswerSubscribeCancelUpdate(user_id,postAnswer_id);
    }
    /*点赞回答*/
    @Override
    public int AnswerLikeInsert(int user_id,int postAnswer_id){
        return postAnswerMapper.AnswerLikeInsert(user_id,postAnswer_id);
    }
    /*点赞回答*/
    @Override
    public int AnswerLikeUpdate(int user_id,int postAnswer_id){
        return postAnswerMapper.AnswerLikeUpdate(user_id,postAnswer_id);
    }
    /*取消点赞回答*/
    @Override
    public int AnswerLikeCancelDelete(int user_id,int postAnswer_id){
        return postAnswerMapper.AnswerLikeCancelDelete(user_id,postAnswer_id);
    }
    /*取消点赞回答*/
    @Override
    public int AnswerLikeCancelUpdate(int user_id,int postAnswer_id){
        return postAnswerMapper.AnswerLikeCancelUpdate(user_id,postAnswer_id);
    }
    /*评论回答*/
    @Override
    public int AnswerCommentInsert(int user_id,int postAnswer_id,String commentAnswer_discribe){
        return postAnswerMapper.AnswerCommentInsert(user_id,postAnswer_id,commentAnswer_discribe);
    }
    /*评论回答*/
    @Override
    public int AnswerCommentUpdate(int user_id,int postAnswer_id,String commentAnswer_discribe){
        return postAnswerMapper.AnswerCommentUpdate(user_id,postAnswer_id,commentAnswer_discribe);
    }
    /*修改回答*/
    @Override
    public int AnswerModify( int user_id,  int postAnswer_id, String postAnswer_title,  String postAnswer_discribe,String postAnswer_img){
        return postAnswerMapper.AnswerModify(user_id,postAnswer_id,postAnswer_title,postAnswer_discribe,postAnswer_img);
    }
    /*获取所有问题*/
    @Override
    public List<PostAnswer> AllAnswer(){
        return postAnswerMapper.AllAnswer();
    }
    /*获取某个问题下的所有回答*/
    @Override
   public List<PostAnswer> AllAnswerInAsk(int postAsk_id){
        return postAnswerMapper.AllAnswerInAsk(postAsk_id);
    }
    /*获取某个角色的所有回答*/
    @Override
    public List<PostAnswer> AllAnswerInUser(int user_id){
        return postAnswerMapper.AllAnswerInUser(user_id);
    }
}
